import React, {useState} from "react";
import { Button } from 'antd';
// import { useEffect, useState } from 'react'

import { useDispatch, useSelector } from 'react-redux'
import { increment, decrement } from '@/store/modules/counterStore'

const Mall = () => {
    const dispatch = useDispatch()
    // let [count, setCounter] = useState([]) 
    // 获取redux中的渠道列表
    let count = useSelector(state => state.counter.count)
    const addEvent = () => {
        dispatch(increment())
    }
    const decrementEvent = () => {
        dispatch(decrement())
    }
    return (
        <div>
            <div>数字：{count}</div>
            <Button type="primary" onClick={addEvent}>add</Button>
            <Button type="primary" onClick={decrementEvent}>minus</Button>
        </div>
    )
}

export default Mall